package com.fsl.springbootstreamkafka.springkafka;

import org.springframework.kafka.core.KafkaTemplate;


/**
 * @author dell
 * spring 操作kafka进行消息发送
 */
public class SpringKafkaProducerTest {

    public static void main(String[] args) throws Exception{

        System.out.println("Start auto");
        KafkaTemplate<String, String> template = SpringKafkaCommon.createTemplate();
        template.setDefaultTopic("mytopic");
        template.sendDefault("0", "fooxxx");
        template.sendDefault("2", "barwww");
        template.sendDefault("0", "bazeee");
        template.sendDefault("2", "quxzzz");
        template.flush();
    }


}
